package com.testDemo.jdk8.lang;

import org.junit.jupiter.api.Test;

/**
 * @Auther: zouren
 * @Date: 2019/7/24 10:13
 * @Description:
 */
public class StringTest {
    @Test
    public  void format() {
        System.out.println("B");
        System.out.println(String.format("%%%s%%","aa"));
        System.out.println("aa");
        System.out.println(String.format("%s%%", "aa"));
        System.out.println(String.format("bbbb%saaa", "cc"));
    }
    @Test
    public  void contains() {
        System.out.println("aaaabbvv".contains("aabb"));
    }
    @Test
    public void lastindtx(){
        String t = "/api/dest/pddesttable/save";
        String[] ts = t.split("/");
        System.out.println(ts[ts.length-2]);
         t = "/api/index/login";
        ts = t.split("/");

        System.out.println(ts[ts.length-2]);
    }
    @Test
    public void substring(){

        System.out.println( "202301".substring(0,4));

        String name = "2023010405".substring(0,6);
        System.out.println(name);

    }

}
